home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / bessel < prev    next >
Internet Message Format  |  1995-03-31  |  2KB

  1. From wscott%EN.ECN.PURDUE.EDU@VM1.NoDak.EDU Wed Feb 21 09:34:51 1990
  2. Date:         Wed, 21 Feb 90 00:16:06 -0500
  3. Reply-To: HP-28 -  HP-28C and HP-28S Calculators <HP-28@VM1.NoDak.EDU>
  4. Sender: HP-28 -  HP-28C and HP-28S Calculators <HP-28@VM1.NoDak.EDU>
  5. From: Wayne H Scott <wscott%EN.ECN.PURDUE.EDU@VM1.NoDak.EDU>
  6. Subject:      new Bessel
  7. X-To:         HP-28@VM1.NoDak.EDU
  8. To: Multiple recipients of list HP-28 <HP-28@NDSUVM1>
  9.  
  10. This is a new version of the bessel function program.  It is faster by
  11. using stack functions and it fixes one bug in the previous posting.
  12.  
  13. This is a function I wrote to aid in my study of FM signal modulation.
  14. It computes the bessel function.
  15. It expects n and x to be on the stack and it returns the result of the
  16. bessel function.
  17. Note it is recursive so it should be named J or change the one reference
  18. to this name within the program.
  19.  
  20. Works on HP28 or HP48
  21.  
  22. Jn
  23. << -> n x <<
  24.    << IF n 0 < THEN
  25.         n NEG x Jn
  26.         n 2 MOD 2 * 1 - * NEG
  27.      ELSE IF x 0 == THEN
  28.      n 0 ==
  29.       ELSE
  30.      17.1032 .2639 n * + .6487 x ABS * + .0018 n * x ABS * -
  31.      .6457 n x ABS MAX * +
  32.      .5 + FLOOR 2 / CEIL 2 *
  33.      1.e-50
  34.      0
  35.      -> m tiny bn <<
  36.        tiny 2 *
  37.        0
  38.        0
  39.        tiny
  40.        m 1 - 0 FOR k
  41.           ROT DROP
  42.           2 k 1 + * OVER * x / 3 PICK -
  43.           IF k n == THEN
  44.              DUP 'bn' STO
  45.           END
  46.           if k 0 == THEN
  47.             DUP 5 ROLL + 4 ROLLD
  48.       ELSE
  49.             IF k 2 MOD 0 == THEN
  50.               DUP 2 * 5 ROLL + 4 ROLLD
  51.             END
  52.       END
  53.        -1 STEP
  54.        3 DROPN
  55.        bn SWAP /
  56.          >>
  57.       END
  58.       END
  59.    >>
  60. >>
  61.  
  62. If entered on a HP-48sx checksum=#9519h  555.5 bytes
  63.  
  64. Ported from MatLab librarys.
  65.  
  66. _______________________________________________________________________________
  67. Wayne Scott             |  INTERNET:   wscott@en.ecn.purdue.edu
  68. Electrical Engineering  |  BITNET:     wscott%ea.ecn.purdue.edu@purccvm
  69. Purdue University       |  UUCP:      {purdue, pur-ee}!en.ecn.purdue.edu!wscott
  70.  
  71.  
  72.